﻿@model List<ReferralTracker.Data.Entities.ReferralSite>

@section scripts {
    <script src="@Url.Content("~/Scripts/Admin/sitedialog.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Admin/index.js")" type="text/javascript"></script>
}

@using (Html.BeginForm()) { 
    <table>
        <thead>
            <tr>
                <td>Referral Sites</td>
            </tr>
            <tr>
                <td>Name</td>
                <td>Url</td>
            </tr>
        </thead>
        <tbody id="sitelist">
            @foreach (var item in Model) {
                <tr id="row_@item.Id">
                    <td><span id="namecol_@item.Id">@item.Name</span></td>
                    <td><span id="urlcol_@item.Id">@item.RootUrl</span></td>
                    <td><a href="javascript:referraltracker.admin.index.deleteSite(@item.Id)">del</a></td>
                    <td><a href="javascript:referraltracker.admin.index.editSite(@item.Id)">edit</a></td>
                </tr>
            }
        </tbody>
        <tfoot>
            <tr>
                <td>
                    <input id="btnAddSite" type="button" value="Add Site" onclick="javascript:referraltracker.admin.index.addSite()" />
                </td>
            </tr>
        </tfoot>
    </table>

}